<template>
  <div id="app">
    <el-container v-if="$route.meta.keepAlive">
      <el-header>
        <topMenu></topMenu>
      </el-header>
      <el-container>
        <div class="side">
          <sideMenu></sideMenu>
        </div>
        <el-container>
          <el-main>
            <router-view></router-view>
          </el-main>
        </el-container>
      </el-container>
    </el-container>

    <!-- 登录页 -->
    <router-view v-if="!$route.meta.keepAlive"></router-view>
  </div>
</template>

<script>
import topMenu from '@/components/home/TopNavMenu'
import sideMenu from '@/components/home/SideNavMenu'
export default {
  name: 'App',
  provide () {
    return {
      reload: this.reload
    }
  },
  data () {
    return {}
  },
  methods: {
    reload () {
      this.RouterState = false
      this.$nextTick(() => {
        this.RouterState = true
      })
    }
  },
  components: {
    topMenu,
    sideMenu
  },
  created () {},
  destroyed () {}
}
</script>

<style>
html,
body {
  height: 100%;
}
#app {
  height: 100%;
}
.el-container {
  height: 100%;
}
.side {
  background-color: #545c64;
}
.el-header {
  background-color: #545c64;
  height: auto !important;
  padding: 0 0 0 0;
}

.el-aside {
  color: #333;
}
</style>
